from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score

# 实际标签

y_true = [1, 0, 1, 1, 0, 1, 0]

# 模型预测结果

y_pred = [1, 0, 1, 0, 0, 1, 1]

# 计算准确率

accuracy = accuracy_score(y_true, y_pred)
precision = precision_score(y_true, y_pred)
recall = recall_score(y_true, y_pred)
f1_scorre = f1_score(y_true, y_pred)
print("Accuracy:", accuracy)
print("Precision", precision)
print("Recall:", recall)
print("F1 Score:", f1_score)
